<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <style>
        .class1{
            width: 90px;
            height: 30px;
            background-color: white;
            border: 1px solid skyblue;
        }
        .class2{
            width: 90px;
            height: 30px;
            background-color: red;
            border: 0;
        }
    </style>
</head>
<body>
<div id="app">
    <button :class="myclass1" @mouseover="change1" @mouseout="trans">教父</button>
    <button :class="myclass2" @mouseover="change2" @mouseout="trans">阿甘正传</button>
    <button :class="myclass3" @mouseover="change3" @mouseout="trans">楚门的世界</button>
    <button :class="myclass4" @mouseover="change4" @mouseout="trans">盗梦空间</button>
</div>

    

    
</body>
<script>
    var vue =new Vue({
        el:'#app',
        data:{
            myclass1:'class2',
            myclass2:'class1',
            myclass3:'class1',
            myclass4:'class1'
        },
        methods:{
            change1(){
                this.myclass1 = 'class2'
            },
            change2(){
                this.myclass1 = 'class1'
                this.myclass2 = 'class2'
            },
            change3(){
                this.myclass1 = 'class1'
                this.myclass3 = 'class2'
            },
            change4(){
                this.myclass1 = 'class1'
                this.myclass4 = 'class2'
            },
            trans(){
                this.myclass1 = 'class2'
                this.myclass2 = 'class1'
                this.myclass3 = 'class1'
                this.myclass4 = 'class1'
            }
        }
    })
</script>
</html>